package alkaid.eis.schedule.task;

import java.util.SplittableRandom;
import java.util.concurrent.TimeUnit;

import org.springframework.stereotype.Component;

import alkaid.eis.schedule.util.ScheduleEisException;

/**
 * 异常任务
 *  
 * @author Lucky Yang
 * @since 0.0.1
 */
@Component
public class ExceptionTask {
    private final static SplittableRandom RANDOM = new SplittableRandom();
    
    public void run() throws InterruptedException {
        TimeUnit.MILLISECONDS.sleep(RANDOM.nextLong(1000L));
        throw new ScheduleEisException("任务执行异常");
    }      
}
